// void, Obj This

Building this;

Sleep(20060+rand(GetConst("RandTimeStart"))+GetConst("AddTimeStart"));

this = This.AsBuilding();

while(.IsValid){
	if(IsAIPlayer(.player)){
		while(.IsValid){
			Sleep(60000);
			if(!IsAIPlayer(.player)) break;
		}
		
	} else {
        if(EnvReadString(.settlement, "burn") == "yes") {
        	if(.health >= 100){
        		.Damage(200);
                if(.settlement.population >= 3)
                    .settlement.SetPopulation(.settlement.population - 3);	
            }
        } else {
        	Sleep(5000);
        }
	}
	Sleep(5000);
}

